<?php
if ( ! function_exists('email_check'))
{
	 
    function email_check($email)
    {
        if (!$this->user_model->get_users(array('user_email' => $email, 'ccb_users.user_category_id' => ($this->uri->segment(3) == 'admin' ? 1 : ($this->uri->segment(3) == 'client' ? 2 : 3))))->row())
        {
            $this->form_validation->set_message('email_check', 'Email does not exist.');
            return FALSE;
        }
        return TRUE;
    }
} 
?>